public class t713 {//乘积小于k的子数组

    public static void main(String[] args) {
        int arr[] = {1,1,1};
        int k = 2;
        int num = numSubarrayProductLessThanK(arr, k);
        System.out.println(num);
    }

    public static int numSubarrayProductLessThanK(int[] nums, int k) {
        int num = 0;
        aa:
        for (int i = 0; i < nums.length; i++) {
            int tmp = 1;
            tmp *= nums[i];
            if(tmp<k){
                num++;
            }else{
                continue ;
            }
            if (nums[i] < k) {
                for (int j = i + 1; j < nums.length; j++) {
                        tmp *= nums[j];
                    if (tmp < k) {
                        num++;
                    } else {
                        continue aa;
                    }
                }
            }
        }

        return num;
    }

}
